<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Gentelella Alela! | </title>

    <!-- Bootstrap -->
    <link href="/resa/vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="/resa/vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="/resa/vendors/nprogress/nprogress.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="/resa/vendors/iCheck/skins/flat/green.css" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link href="/resa/build/css/custom.min.css" rel="stylesheet">


      <!-- bootstrap-daterangepicker -->
      <link href="/resa/vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
      <!-- bootstrap-datetimepicker -->
      <link href="/resa/vendors/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
      <!-- PNotify -->
      <link href="/resa/vendors/pnotify/dist/pnotify.css" rel="stylesheet">
      <link href="/resa/vendors/pnotify/dist/pnotify.buttons.css" rel="stylesheet">
      <link href="/resa/vendors/pnotify/dist/pnotify.nonblock.css" rel="stylesheet">
      <style>
  	tr{
  		cursor: pointer;
  	}
  	::-webkit-scrollbar {/*滚动条*/
		    height: 5px;
		    width: 5px;
		}
		::-webkit-scrollbar-track {/*滚动槽*/
		    -webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);
		    border-radius:10px;
		}
		::-webkit-scrollbar-thumb {/*滚动条滑块*/
		    border-radius:10px;
		    background:rgba(0,0,0,0.1);
		    -webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.5);
		}
  	.success{
  		background-color:rgba(34,215,187,.3);
  		color:#878787;
  		padding: 5px 15px;
  		border-radius: 3px;
  		font-size: 14px;

  	}
    .modal-backdrop {
        filter: alpha(opacity=0)!important;
        opacity: 0!important;
    }
  	th{
  		padding-left: 10px;
  	}
	.ing{
		background-color:rgba(243,197,65,.3);
		color:#878787;
		padding: 5px 15px;
		border-radius: 3px;
		font-size: 14px;
	}
	.ing i{
		color: #FEA31D;
	}

	.error{
		background-color:rgba(244,197,202,.3);
		color:#878787;
		padding: 5px 15px;
		border-radius: 3px;
		font-size: 14px;
	}
	.error i{
		color: #F95A55;
	}
	.yanfa{
		color: #1FD6BB;
	}
	.task{
		color: #64BF62;
	}
	.quexian{
		color:#F95A55
	}

    .addTask{
        width: 20px;
        padding: 10px 20px;
        background: #B9EFE7;
        line-height: 55px;
        color: black;
        position: relative;
        overflow: hidden;
        border-bottom-left-radius: 15%;
        border-top-left-radius: 15%;
        cursor: pointer;
    }
    .addTask:active{
        right: -10px;
    }
    .addTask::after{
        content: "";
        width: 35px;
        height: 35px;
        background-color:#fff;
        position: absolute;
        top: 0;
        right: -17.5px;
        display: block;
        border-radius: 50%;
    }
    .forms input{
        border-color: #EDEDED;
        border-radius: 5px;
        height: 40px;
        margin: 10px 2px;
        width: 80%;
    }
    .data{

        border-color: #EDEDED;
        border-radius: 5px;
        height: 40px;
        margin: 10px 2px;
        width: 80%;
    }
    .forms input:hover,input:focus {
        border-color: #1FD6BB;
        transition: all 1;
    }
    .forms select{
        border-color: #EDEDED;
        border-radius: 5px;
        height: 40px;
        margin: 10px 2px;
        width: 80%;
    }
    .forms select:hover,select:focus {
        border-color: #1FD6BB;
        transition: all 1;
    }


    .forms textarea{
        border-color: #EDEDED;
        border-radius: 5px;
        height: 80px;
        margin: 10px 2px;
        width: 80%;
    }
    .forms textarea:hover,textarea:focus {
        border-color: #1FD6BB;
        transition: all 1;
    }


    .form-horizontal .control-label {
        padding-top: 20px;
    }

    .quebtn{
        padding: 9px 31px;
        border-radius: 19px;
        background: #1FD6BB;
        color: white;
        border: 0px;
    }
    .requiredcolor{
        color: red;
    }
    #addTask{
        border-radius: 10px;

    }
    .yanfa{
        color: #1FD6BB;
    }
    .task{
        color: #64BF62;
    }
    .quexian{
        color:#F95A55
    }
  </style>
  </head>

  <body class="nav-md" style="background: #F0F0F0">
  <span id="pid" style="display: none" th:text="${pid}"></span>
  <div class="modal  fade" id="addTask" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" > <!--data-backdrop="static"-->
      <div class="modal-dialog" style="width: 850px;">

          <div class="modal-content" style="width: 850px;">
              <div class="row">
                  <div class="col-md-12 col-sm-12 col-xs-12">
                      <div class="x_panel">
                          <div class="x_title">
                              <h2>任务添加</h2>
                              <div class="clearfix"></div>
                          </div>
                          <div class="x_content">
                              <form class="form-horizontal form-label-left forms" id="addTaskForm" novalidate>
                                  <div class="row">

                                    <span class="control-label col-md-2 " for="name"><span class="required requiredcolor">*</span>标题
                                    </span>
                                      <div class="col-md-10">
                                          <input id="name" name="title" class="form-control col-md-7 col-xs-12" data-validate-length-range="6" data-validate-words="2" placeholder="请输入标题" required="required" type="text">
                                      </div>
                                  </div>
                                  <div class="row">
                                      <span class="control-label col-md-2 " for="name">类型</span>
                                      <div class="col-md-4">
                                          <select type="text" name="ttypeid" data-validate-linked="email" required="required" class="form-control col-md-7 col-xs-12">
                                              <option value="1">研发需求</option>
                                              <option value="2">研发任务</option>
                                              <option value="3">缺陷</option>
                                          </select>
                                      </div>


                                      <!--</div>-->
                                      <div class="item form-group">
                                          <span class="control-label col-md-1 " for="name">负责人</span>
                                          <div class="col-md-3">
                                              <select id="fuzheren" type="text" name="tuserid" data-validate-linked="email" required="required" class="form-control col-md-7 col-xs-12">
                                                  <option th:each="info,infoStat : ${admin}" th:attr="value=${info.id}" th:text="${info.account}">用户1</option>
                                              </select>
                                          </div>
                                      </div>
                                  </div>

                                  <div class="row">
                                      <div class="item form-group">
                                          <span class="control-label col-md-2 " for="name">截止时间</span>
                                          <!--<div class="col-md-9">-->
                                          <fieldset>
                                              <div class="control-group">
                                                  <div class="controls">
                                                      <div class="col-md-5 xdisplay_inputx form-group has-feedback">
                                                          <input type="text" name="tenddate" class="form-control has-feedback-left" id="single_cal2" placeholder="First Name" aria-describedby="inputSuccess2Status2">
                                                          <span class="fa fa-calendar-o form-control-feedback left" aria-hidden="true"></span>
                                                          <span id="inputSuccess2Status2" class="sr-only">(success)</span>
                                                      </div>
                                                  </div>
                                              </div>
                                          </fieldset>
                                          <!--</div>-->
                                      </div>
                                  </div>
                                  <div class="item form-group">
                                      <span class="control-label col-md-2 " for="name">优先级别</span>
                                      <div class="col-md-10">
                                          <select  name="torderby" data-validate-linked="email" required="required" class="form-control col-md-7 col-xs-12">
                                              <option value="正常">正常</option>
                                              <option value="紧急">紧急</option>
                                              <option value="非常紧急">非常紧急</option>
                                          </select>
                                      </div>
                                  </div>

                                  <div class="ln_solid"></div>
                                  <div class="form-group">
                                      <div class="col-md-6 col-md-offset-2">
                                          <button type="button" id="submit" class="quebtn">确定</button>
                                      </div>
                                  </div>
                              </form>
                          </div>
                      </div>
                  </div>
              </div>


          </div>
      </div>
  </div>
  </div>
  </div>


    <!--<div class="container body">-->
      <div class="main_container">


        <!-- page content  right_col-->
        <div class="" role="main">
          <div class="">
            <!--<div class="page-title">
             <div class="title_left">
                <h3><small>Project Progress list</small></h3>
              </div>

              <div class="title_right">
                <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
                  <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search for...">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="button">Go!</button>
                    </span>
                  </div>
                </div>
              </div>
            </div>-->

            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12">



                <div class="x_panel">

              			 <div class="x_title" style="border: 0px;padding: initial;">
                    <!--<h2>  <i class="menu-icon fa fa-user"></i>   项目透视</h2>-->
                             <div class="col-md-5  col-lg-offset-4" style="text-align: right;right:-20px">
                                 <span class="addTask" id="addTaskBtn"><i class="fa fa-plus-square" style="color: #1FD6BB;">&nbsp;</i>添加任务</span>
                             </div>
                             <div class="stat-icon dib flat-color-4 ">

                                 <div class="col-md-3 col-sm-5 col-xs-12 form-group pull-right top_search" style="    top: 10px;">

                                     <div class="input-group">
                                         <input type="text" id="queryTaskText" class="form-control" placeholder="Search for Project Name">
                                         <span class="input-group-btn">
		                      <button class="btn btn-default" id="queryTaskBtn" type="button">Go!</button>
		                    </span>
                                     </div>
                                 </div>
                                 <!--<ul class="nav navbar-right panel_toolbox">
                  <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                  <li><a class="close-link"><i class="fa fa-close"></i></a> </li>
                </ul>-->
                    <!--<div class="clearfix" style="background: white;"></div>
                    </div>-->
                  </div>


                  <div class="x_content">
					 					<div class="title_left">
					                <!--<h3><small>Simple table with project listing with progress and editing options</small></h3>-->
					          </div>
                    <!--<p>Simple table with project listing with progress and editing options</p>-->


                    <!-- start project list -->
                    <table class="table table-striped projects" >
                      <thead>
                        <tr>
                          <th style="width: 1%">#</th>
                          <th style="width: 10%">任务编号</th>
                          <th style="width: 15%">标题</th>
                          <th style="width: 18%">状态</th>
                          <th style="width: 10%">负责人</th>
                          <th style="width: 12%">截止时间</th>
                          <th style="width: 10%">任务类型</th>
                        </tr>
                      </thead>
                      <tbody style="color: #536A7F;">

                        <tr th:each="info,infoStat : ${taskList}">
		                          <td th:text="${info.tId}"></td>
		                          <td>
		                           	<span style="background-color:rgba(34,215,187,.1);color: #22d7bb;padding: 5px;" th:text="${info.tNumber}">9</span>
		                          </td>
		                          <td th:text="${info.title}">
		                             dawd
		                          </td>
		                          <td class="project_progress">

			                           <div class="" th:utext="${info.StatusIcon}">
			                           		<span class="success"><i class="menu-icon fa fa-check-circle" style="color: #00c292;"></i>已完成</span>
			                           </div>
		                          </td>
		                          <td>
		                            <img th:attr="src=${info.url}+${info.filePath}" class="avatar" alt="Avatar">
		                          </td>
		                          <td th:text="${info.endtime}" th:attr="style=${info.style}" >

		                          </td>
		                          <td>
		                           <div class="col-md-12 cs" style="color: black; padding-top: 1rem;" th:utext="${info.icon}+${info.tName}">
									   <i class="menu-icon fa fa-check-square" style="color: #00c292;"></i>敏捷任务
								   </div>
		                          </td>
		                        </tr>

                      </tbody>
                    </table>
                    <!-- end project list -->

                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->


      </div>
    <!--</div>-->

    <!-- jQuery -->
    <script src="/resa/vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="/resa/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="/resa/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="/resa/vendors/nprogress/nprogress.js"></script>
    <!-- bootstrap-progressbar -->
    <script src="/resa/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="/resa/build/js/custom.min.js"></script>

          <!-- bootstrap-daterangepicker -->
          <script src="/resa/vendors/moment/min/moment.min.js"></script>
          <script src="/resa/vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
          <!-- bootstrap-datetimepicker -->
          <script src="/resa/vendors/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
          <!-- PNotify -->
          <script src="/resa/vendors/pnotify/dist/pnotify.js"></script>
          <script src="/resa/vendors/pnotify/dist/pnotify.buttons.js"></script>
          <script src="/resa/vendors/pnotify/dist/pnotify.nonblock.js"></script>
    <script>
    	$(function(){
            $("#queryTaskBtn").click(function(){
                var data=$("#queryTaskText").val();
                console.log(data)
                if(data=='' ||data=="" || data==null){
                    window.location.href='/resa/project/project_table/'+$("#pid").text()+'.do';
                }else{
                    window.location.href='/resa/project/project_table/'+$("#pid").text()+'.do?taskName='+data;
                }
            });


            $("#addTaskBtn").click(function(){
                $('#addTask').modal("toggle");
                $('#fuzheren').html('');
                $.ajax({
                    url:'/resa/project/queryProjectAdmin.do',
                    dataType:'json',
                    type:'post',
                    success:function (result) {
                        console.log(result)
                        content="";
                        $(result).each(function(jj,mms){
                            content+='<option value="'+mms.id+'">'+mms.account+'</option>'
                        })
                        $('#fuzheren').html(content);
                    }
                })

            })

            $('#task2', window.parent.document).on('hide.bs.modal', function () {
                var tas=$('#task2', window.parent.document)

                console.log(tas)
                $(tas).find("#modl").show();

            })


            $('tbody tr').click(function(){
                var tid=$($(this).children("td")[0]).text()
                // console.log($($(this).children("td")[0]).text())
                // console.log($(window.top.document.getElementById('task2')))
                // console.log()
                // $('#task2', window.top.document).modal("show")
                // $('#task2', window.top.document).addClass("show")
                // $('#task2', window.top.document).removeClass("in")
                // console.log($(window.top)[0])
                $(window.top)[0].show(tid);
                window.location.reload(true);
            })

            $("#submit").click(function(){

                var date=$("#addTaskForm").serialize();
                console.log($('#fuzheren').val())
                if($('#name').val()=='' || $('#name').val()==null){
                    new PNotify({
                        title: "错误信息",
                        text: "请输入标题",
                        type:"error",
                        styling: 'bootstrap3'
                    });
                    return false;
                }
                if($('#fuzheren').val()=='' || $('#fuzheren').val()==null){
                    new PNotify({
                        title: "错误信息",
                        text: "请在设置中添加项目参与人",
                        type:"error",
                        styling: 'bootstrap3'
                    });
                    return false;
                }

                $.ajax({
                    url:"/resa/project/insertTask/"+$("#pid").text()+".do",
                    data:date,
                    type:'POST',
                    dataType:"json",
                    success:function(result){
                        if(result.code==200){
                            new PNotify({
                                title: result.title,
                                text: result.text,
                                type: result.type,
                                styling: 'bootstrap3'
                            });

                            setTimeout(function(){
                                $('#addTask').modal("toggle");
                                window.parent.location.reload(true);
                                // window.location.href='/resa/project/project_table/'+$("#pid").text()+'.do'
                            },1000);
                        }
                    },error:function(){
                        new PNotify({
                            title: "添加任务",
                            text: "添加任务失败！请检查",
                            type:"error",
                            styling: 'bootstrap3'
                        });
                    }
                })

            })


        });
         </script>
  </body>
</html>